<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>" />
    <title>JSP论坛--创建新帖</title> 
   	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Page-Enter" content="revealTrans(duration=3,transtion=23)" />
	<meta http-equiv="Page-Exit" content="revealTrans(duration=3，transtion=23)" />
	<meta name="keywords" content="论坛,BBS,JSP论坛,软件工程学院" />
	<meta name="description" content="JSP论坛  我们交流的平台" />	
	<meta name="author" content="软件工程学院" />
	<meta name="copyright" content="2010-2012 成都信息工程学院软件工程学院软工104" />
	<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" /> 
	<link rel="stylesheet" type="text/css" href="css/common.css" />
  </head>

	<body>
		<div id="main">
			<%@include file="head.jsp"%>
			<%
				if (username != null && password != null) {
			%>
			<p>
				创建新帖：标题和内容均不能小于5个字符
			</p>
			<form action="createTopic" method="post" name="creatTopic" onsubmit="return topicCheck();">
				主题：
				<input type="text" name="topicTitle" id="topicTitle" maxlength="40" size="60" />
				<p></p>
				<font style="vertical-align: top">内容：</font>
				<textarea name="topicContent" id="topicContent" rows="10" cols="50"></textarea>
				<br />				
				<input type="submit" name="submit" value="提交" class="sub" />
				<input type="reset" value="重填" class="sub" />
			</form>

			<%
				} else {
					out.print("你尚未登陆，请登陆");
				}
			%>

			<jsp:include page="foot.jsp" />
		</div>
	<script type="text/javascript">
		function topicCheck() {
			var topicTitle = document.getElementById("topicTitle").value;
			var topicContent = document.getElementById("topicContent").value;
			if(topicContent == "共产党" || topicContent == "中共" || topicContent == "民主"
					 || topicContent == "中共"  || topicContent == "中共" || topicContent == "中共"
					  || topicContent == "中国共产党" || topicContent == "胡锦涛" || topicContent == "反共"
					   || topicContent == "反党" || topicContent == "反国家" || topicContent == "习近平"
					    || topicContent == "李克强" || topicContent == "游行" || topicContent == "集会"
					     || topicContent == "强奸" || topicContent == "走私" || topicContent == "强暴"
					      || topicContent == "摇头丸" || topicContent == "白粉" || topicContent == "冰毒"
					       || topicContent == "海洛因" || topicContent == "假钞" || topicContent == "人民币"
					        || topicContent == "假币" 
					         || topicTitle == "共产党" || topicTitle == "中共" || topicTitle == "民主"
					 	 	  || topicTitle == "中国共产党" || topicTitle == "胡锦涛" || topicTitle == "反共"
					   		   || topicTitle == "反党" || topicTitle == "反国家" || topicTitle == "习近平"
					            || topicTitle == "李克强" || topicTitle == "游行" || topicTitle == "集会"
					             || topicTitle == "强奸" || topicTitle == "走私" || topicTitle == "强暴"
					              || topicTitle == "摇头丸" || topicTitle == "白粉" || topicTitle == "冰毒"
					               || topicTitle == "海洛因" || topicTitle == "假钞" || topicTitle == "人民币"
					                || topicTitle == "假币")
			{
				
				alert("抱歉！您在创建新帖的时候输入了敏感词汇！");
				
				return true;
				
			}else{
				
				if (topicTitle.length > 4 && topicContent.length > 4) {
					return true;
				} else {
					alert("请按要求输入");
					return false;
				}
				return true;
			}
			
		}
	</script>
	</body>
</html>
